package com.example.demo.activity;

import android.content.Intent;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.example.demo.databinding.ActivityMainBinding;

public class MainActivity extends AppCompatActivity {

    private ActivityMainBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        binding = ActivityMainBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        bindButtonsClick();

    }

    private void bindButtonsClick() {
        binding.mainNewsBtn.setOnClickListener((v)->{
            startActivity(new Intent(this, NewsListActivity.class));
        });

        binding.mainNewsTodayHis.setOnClickListener((v)->{
            startActivity(new Intent(this, DayInHistoryActivity.class));
        });

        binding.mainAstroBtn.setOnClickListener((v)->{
            startActivity(new Intent(this, AstroActivity.class));
        });

        binding.mainGoldBtn.setOnClickListener((v)->{
            startActivity(new Intent(this, GoldActivity.class));
        });

        binding.mainPhoneBtn.setOnClickListener((v)->{
            startActivity(new Intent(this, PhoneActivity.class));
        });
    }

}